#ifndef _USART_H_
#define _USART_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <types.h>
#include "device.h"

#define SERIAL_CONFIG_DEFAULT   \
{                               \
    9600,                       \
    8,                          \
    'e',                        \
}

struct usart_cfg
{
    u32     baud;
    u8      databits;
    char    parity;
};

int uart_dev_add(const char *name, const struct usart_cfg *cfg);
void uart_dev_del(device_t *dev);

#ifdef __cplusplus
}
#endif
#endif
